package com.hn658.base.message.notification.notify.business.impl;

import com.hn658.base.message.notification.notify.dao.INotifyMongoDBDao;
import com.hn658.base.message.notification.notify.entity.NotificationEO;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by baihai on 2015/11/26.
 */
public abstract class AbstartNotifiCationManager  {


    @Autowired
    protected INotifyMongoDBDao notifyMongoDBDao;

    public NotificationEO find(String notifyId){

        return notifyMongoDBDao.findByNotifyId(notifyId);
    }

    public NotificationEO save(NotificationEO notificationEO){

        Long id = notifyMongoDBDao.getMaxId();

        notificationEO.setId(id+1);

        notifyMongoDBDao.insert(notificationEO);

        return notificationEO;
    }

    public void update(NotificationEO notification){

        notifyMongoDBDao.update(notification);
    }

}
